package com.example.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService;

@RestController
public class ExecController {

//	@Value("${ansible.username}")
	private String username;
//	@Value("${ansible.password}")
	private String password;
//	@Value("${ansible.host}")
	private String host;
	
	@Autowired
	private RedisConfig redisConfig;
	
	@RequestMapping("/exec")
	public String exec(String command) {
//		RedisTemp.setadd("command_queue", command);
		Config config = ConfigService.getAppConfig();
		return redisConfig.getJedis().keys("*").toString();
	}
	
	@Value("${foo}")
	private String foo;
	
	@Value("${gitlab}")
	private String gitlab;
	
	@RequestMapping("/foo")
	public String foo() {
		return foo;
	}
	@RequestMapping("/gitlab")
	public String gitlab() {
		return gitlab;
	}
}
